package org.airline.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.airline.utils.DateUtil;

@Entity
public class User {

	private int id;
	private String userName;
	private String password;
	private String trueName;
	private String sex;
	private String regDate = DateUtil.parseToString(new Date());
	private String tel;
	private String address;
	private String email;
	private String idCard; // 身份证
	private int rank = 5; // 等级
	private List<Message> messageList;
	private List<Notice> noticeList;
	private List<OrderItem> orderItemList;

	public String getAddress() {
		return address;
	}

	public String getEmail() {
		return email;
	}

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public String getPassword() {
		return password;
	}

	public String getSex() {
		return sex;
	}

	public String getTel() {
		return tel;
	}

	public String getTrueName() {
		return trueName;
	}

	public String getUserName() {
		return userName;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public void setTrueName(String trueName) {
		this.trueName = trueName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public String getRegDate() {
		return regDate;
	}

	public void setRegDate(String regDate) {
		this.regDate = regDate;
	}

	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
	public List<Message> getMessageList() {
		return messageList;
	}

	public void setMessageList(List<Message> messageList) {
		this.messageList = messageList;
	}

	@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
	public List<Notice> getNoticeList() {
		return noticeList;
	}

	public void setNoticeList(List<Notice> noticeList) {
		this.noticeList = noticeList;
	}
	
	@OneToMany(mappedBy = "user" , cascade = CascadeType.ALL)
	public List<OrderItem> getOrderItemList() {
		return orderItemList;
	}

	public void setOrderItemList(List<OrderItem> orderItemList) {
		this.orderItemList = orderItemList;
	}
	
	
	
}
